using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
 
namespace MyFirstBot
{
    class MyFirstBot
    {
        public static SecondLife client = new SecondLife();
 
        private static string first_name = "test";
        private static string last_name = "user";
        private static string password = "test";
 
        public static void Main()
        {
            client.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected);
            LoginParams p = client.Network.DefaultLoginParams(first_name, last_name, password, "My First Bot", "Your name");
            p.URI="http://localhost:9000";
            if (client.Network.Login(p))
            {
                Console.WriteLine("I logged into OpenSim!");
            }
            else
            {
                Console.WriteLine("I couldn't log in, here is why: " + client.Network.LoginMessage);
            }
        }
 
        static void Network_OnConnected(object sender)
        {
//            Console.WriteLine("I'm connected to the simulator, going to greet everyone around me");
//            client.Self.Chat("Hello World!", 0, ChatType.Normal);
            Console.WriteLine("Now I am going to logout of SL.. Goodbye!");
            client.Network.Logout();
        }
    }
}
 
